﻿using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;


public class PopupUtility
{
	static public void OneButtonErrorPopupNoBackground(string popupContent)
	{
		Popup_Error _popup = PopupManager.PushPopup(PopupKind.Error) as Popup_Error;
		_popup.SetPopupWithTitleAndBody(Localization.Get("uiCommonTextwarning"), popupContent);
	}

	static public void OneButtonErrorPopupNoBackground(int ecode)
	{
		Popup_Error _popup = PopupManager.PushPopup(PopupKind.Error) as Popup_Error;
		_popup.SetPopupWithTitleAndBody(Localization.Get("uiCommonTextwarning"), Localization.Get(string.Format("systemErrorText{0}", System.Math.Abs(ecode))));
	}

	static public void OneButtonErrorPopup(string popupContent)
	{
		Popup_OneButton _popup = PopupManager.PushPopup(PopupKind.OneButton) as Popup_OneButton;
		_popup.SetPopupWithTitleAndBody(Localization.Get("uiCommonTextwarning"), popupContent);
	}

	static public void OneButtonErrorPopup(int ecode)
	{
		Popup_OneButton _popup = PopupManager.PushPopup(PopupKind.OneButton) as Popup_OneButton;
		_popup.SetPopupWithTitleAndBody(Localization.Get("uiCommonTextwarning"), Localization.Get(string.Format("systemErrorText{0}", System.Math.Abs(ecode))));
	}

	static public void PopAll()
	{
		while (PopupManager.Instance.m_PopupStack.Count > 0)
		{
			PopupManager.PopPopup();
		}
	}
}